package com.emps_vue.demo.Service;

import com.emps_vue.demo.Dao.DaoSaveEmp;
import com.emps_vue.demo.Entity.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class EmpServiceImpl implements EmpService {
    @Resource
    private DaoSaveEmp daoSaveEmp;

    @Override
    public void update(Emp emp) {
        daoSaveEmp.update(emp);
    }

    @Override
    public Emp findOne(String id) {
        return daoSaveEmp.findOne(id);

    }

    @Override
    public void delete(String id) {
        daoSaveEmp.delete(id);
    }

    @Override
    public void save(Emp emp) {
        daoSaveEmp.save(emp);
    }

    @Override
    public List<Emp> findAll() {
        return daoSaveEmp.findAll();
    }
}
